local 合成旗类 = class()

function 合成旗类:初始化()
	self.本类开关 = false
	self.小地图资源 = {
		[1004.0] = "B522C713",
		[1130.0] = "C9E935A3",
		[1126.0] = "63033A32",
		[1120.0] = "6B2B2EA7",
		[1186.0] = "53EC9A6E",
		[1190.0] = "2FC18B92",
		[1192.0] = "A2C1DE00",
		[1198.0] = "20705313",
		[1202.0] = "78BF64A4",
		[1204.0] = "C8011EF1",
		[1512.0] = "3436B7ED",
		[1006.0] = "43471CC3",
		[1180.0] = "22D0EB49",
		[1177.0] = "3EA72B1F",
		[1173.0] = "52CA91A8",
		[1122.0] = "9AFBFBC8",
		[1142.0] = "CA5082AD",
		[1174.0] = "C4523BAE",
		[1178.0] = "FF998899",
		[1182.0] = "D2575ED4",
		[1118.0] = "D558F867",
		[1513.0] = "DE4D90EE",
		[1001.0] = "CEBC4615",
		[1507.0] = "C8748621",
		[1511.0] = "B9E253E6",
		[1181.0] = "674490C6",
		[1203.0] = "F0CE9045",
		[1183.0] = "EADE2B36",
		[1188.0] = "5258A786",
		[1189.0] = "0F326E75",
		[3131.0] = "614B45F3",
		[1128.0] = "C97CEECD",
		[1131.0] = "614B45F3",
		[1207.0] = "C27C1229",
		[1501.0] = "A0CD8BBA",
		[4133.0] = "80B40884",
		[1119.0] = "A70FCC68",
		[1111.0] = "80B40884",
		[1091.0] = "2691C760",
		[1135.0] = "B23B05EC",
		[1129.0] = "15118E61",
		[1127.0] = "6AFF3A47",
		[1121.0] = "49AC5547",
		[1092.0] = "AEAEAF33",
		[1187.0] = "88247560",
		[1208.0] = "5524B32A",
		[1191.0] = "950C1B87",
		[1193.0] = "242616F7",
		[1201.0] = "78D6FD06",
		[1205.0] = "CB3B68B8",
		[4131.0] = "C8011EF1",
		[1179.0] = "296F3D1B",
		[1005.0] = "B56504B2",
		[1007.0] = "DBF85229",
		[1514.0] = "30CBF5F6",
		[1002.0] = "D48EE39D",
		[1506.0] = "3303D9A1",
		[1508.0] = "905A7A55",
		[1008.0] = "070872BE",
		[1070.0] = "A4EA11C8",
		[1116.0] = "207DAB6D",
		[1114.0] = "6B7904C6",
		[1110.0] = "481296D9",
		[1092.0] = "AEAEAF33",
		[1090.0] = "3A2C78B5",
		[1146.0] = "0C524261",
		[1040.0] = "FE7FC64D",
		[1140.0] = "E1BC6C78"
	}
	self.地图数据 = {
		[1001] = {
			x = 11000,
			y = 5600
		},
		[1501] = {
			x = 5760,
			y = 2880
		},
		[1208] = {
			x = 2599,
			y = 687
		},
		[1070] = {
			x = 3200,
			y = 4200
		},
		[1092] = {
			x = 4480,
			y = 3020
		},
		[1040] = {
			x = 2900,
			y = 2520
		}
	}
end

function 合成旗类:刷新(数据)
	if 数据.地图 == "傲来国" then
		-- Nothing
	elseif 数据.地图 == "建邺城" then
		-- Nothing
	elseif 数据.地图 == "长安城" then
		-- Nothing
	elseif 数据.地图 == "长寿村" then

	elseif 数据.地图 == "朱紫国" then
		-- Nothing
	elseif 数据.地图 == "西凉女国" then
		-- Nothing
	end

	self.图片1 = WAS动画类.创建(smap, "0x" .. self.小地图资源[数据.编号]) --,15
	self.背景 = self.图片1.动画.精灵
	self.本类开关 = true
	self.高度 = self.背景:取高度()
	self.宽度 = self.背景:取宽度()
	self.小地图 = {
		x = self.地图数据[数据.编号].x / self.宽度,
		y = self.地图数据[数据.编号].y / self.高度
	}
	self.x = 100
	self.y = 100
	self.坐标数据 = {}

	for n = 1, #数据.坐标, 1 do
		self.坐标数据[#self.坐标数据 + 1] = {
			图片 = 图像类("Dat/smap/小地图物件.png"),
			x = 数据.坐标[n].x * 20,
			y = 数据.坐标[n].y * 20
		}
	end
end

function 合成旗类:更新(dt)
	self.坐标点击 = false

	for n = 1, #self.坐标数据, 1 do
		if self.坐标点击 == false and self.坐标数据[n].图片:取包围盒():检查点(鼠标.x, 鼠标.y) and 引擎.鼠标弹起(左键) then
			客户端:发送数据(n, 59, 13, "71")

			self.坐标点击 = true
		end
	end

	if self.背景:取包围盒():检查点(鼠标.x, 鼠标.y) and 引擎.鼠标弹起(右键) then
		self.本类开关 = false
	end
end

function 合成旗类:界面重叠()
	if self.背景:取包围盒():检查点(鼠标.x, 鼠标.y) then
		return true
	else
		return false
	end
end

function 合成旗类:显示(x, y)
	self.背景:显示(self.x, self.y)

	for n = 1, #self.坐标数据, 1 do
		self.坐标数据[n].图片:显示(self.x + self.坐标数据[n].x / self.小地图.x - 6, self.y + self.坐标数据[n].y / self.小地图.y - 11)
	end
end

return 合成旗类
